package ui.component {

	import flash.display.BitmapData;
	import flash.text.TextFormatAlign;
	
	public class TextButton extends Button {
		
		private var label:Label;

		public function TextButton(text:String, upData:BitmapData, overData:BitmapData, outData:BitmapData, handler:Function) {
			super(upData, overData, outData, handler);
			
			label = new Label(12, 0xFFFFFF, true, TextFormatAlign.CENTER, true);
			label.text = text;
			label.x = (width - label.width) * 0.5;
			label.y = (height - label.height) * 0.5;
			addChild(label);
		}
		
		public function getLabel():Label {
			return label;
		}
	}
}